package com.liaozl.sca.account.feign;

import com.liaozl.sca.account.dto.AccountDTO;
import com.liaozl.sca.common.constants.ServiceNames;
import com.liaozl.sca.common.dto.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Description:
 * @version: v1.0.0
 * @author: liaozuliang
 * @date: 2021/9/17 17:07
 */
@FeignClient(value = ServiceNames.ACCOUNT_WEB)
public interface AccountFeign {

    @PostMapping("/account/insert")
    Result<Boolean> insert(@RequestBody AccountDTO accountDTO);

    @PostMapping("/account/delete")
    Result<Boolean> delete(@RequestParam("userId") Long userId);

    @GetMapping("/account/delete2")
    Result<Boolean> delete2(@RequestParam("userId") Long userId);

    @PostMapping("/account/update")
    Result<Boolean> update(@RequestBody AccountDTO accountDTO);

    @GetMapping("/account/getByUserId/{userId}")
    Result<AccountDTO> getByUserId(@PathVariable("userId") Long userId);

    @GetMapping("/account/getByUserId2/{userId}")
    Result<AccountDTO> getByUserId2(@PathVariable("userId") Long userId);
}
